<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let obj1 = {
            name: '李四',
            age: 20,
            num: 18,
            sing: function () {
                console.log('唱歌')
            }
        }

        let obj2 = obj1
        console.log(obj2)

        obj2.name = '张三'
        console.log(obj2)
        //由于obj1和obj2在栈里面的地址值一样
        // 导致我们修改obj2时obj1的值发生改变
        console.log(obj1)
    </script>

</body>

</html>